package com.common.base.manager

import android.Manifest
import android.app.Activity
import com.common.base.tools.extend.requestPermission

/**
 * Created by zsf on 2022/8/19 17:17
 * ******************************************
 * * 权限管理
 * ******************************************
 */
object PermissionManager {
    //写内存
    @JvmStatic
    var PER_WRITE_EXTERNAL_STORAGE = Manifest.permission.WRITE_EXTERNAL_STORAGE
    //读内存
    @JvmStatic
    var PER_READ_EXTERNAL_STORAGE = Manifest.permission.READ_EXTERNAL_STORAGE
    //照相机
    @JvmStatic
    var PER_CAMERA = Manifest.permission.CAMERA

    /**
     * kotlin 直接调用 requestPermission 有扩展函数
     */
    @JvmStatic
    fun reqeustPermission(activity: Activity,list:List<String>, onSuccess: () -> Unit, onFailed: (MutableList<String>,Boolean) -> Unit) {
        activity.requestPermission(list,onSuccess,onFailed)
    }
}